//
//  HJNewsTabListModel.m
//  KaiChat
//
//  Created by lx on 2024/3/14.
//

#import "HJNewsTabListModel.h"

@implementation HJNewsTabListModel

+ (HJNewsTabListModel *)modelWithDict:(NSDictionary *)dict {
    
    HJNewsTabListModel *model = [[HJNewsTabListModel alloc] init];
    NSArray *likeArr = dict[@"like"];
    NSMutableArray *likeMArr = [[NSMutableArray alloc] init];
    [likeArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        HJNewsTabModel *sub = [HJNewsTabModel modelWithDict:obj];
        [likeMArr addObject:sub];
        
    }];
    model.likeTabs = likeMArr;
    
    NSArray *tagArr = dict[@"tag"];
    NSMutableArray *tagMArr = [[NSMutableArray alloc] init];
    [tagArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        HJNewsTabModel *sub = [HJNewsTabModel modelWithDict:obj];
        [tagMArr addObject:sub];
        
    }];
    
    model.tagTabs = tagMArr;
    
    return model;
}

@end
